<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>

</body>
<script type="text/javascript">
    window.onload = function () {
        var divElement = document.createElement("div");
        var textNode = document.createTextNode("sdasdasdsadasd");
        divElement.appendChild(textNode);
        document.body.appendChild(divElement);
    }
</script>
<script type="text/javascript">
    var i = 1;
    setInterval(function () {
        var imgId = document.getElementById("imgid");
        if (i <= 3) {
            i++;
        } else {
            i = 1;
        }
        imgId.src = "img/" + i + ".jpg";
    }, 3000);


</script>
</html>